﻿package mortal.game.view.copy.petBreak
{
    import flash.events.*;
    import mortal.game.events.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;
    import mortal.mvc.core.*;

    public class PetBreakCopyIcon extends ActionBaseIcon
    {
        private static var _instance:PetBreakCopyIcon;

        public function PetBreakCopyIcon(param1:String)
        {
            super(param1);
            return;
        }// end function

        override protected function clickHandler(event:MouseEvent) : void
        {
            if (GameController.copy.petBreakCopy.isViewShow)
            {
                GameController.copy.petBreakCopy.view.hide();
            }
            else
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.PetBreakCopyOpenByIndex));
            }
            return;
        }// end function

        public static function get instance() : PetBreakCopyIcon
        {
            if (!_instance)
            {
                _instance = new PetBreakCopyIcon(ResFileConst.PetBreakIcon);
            }
            return _instance;
        }// end function

        public static function get hasInstance() : Boolean
        {
            return _instance != null;
        }// end function

    }
}
